cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
project(platform LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

add_executable(helloworld main.cpp)

target_compile_definitions(helloworld PUBLIC "COMPILER_NAME=\"${CMAKE_CXX_COMPILER_ID}\"")

message(STATUS "COMPILER: ${CMAKE_CXX_COMPILER_ID}")

if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
  target_compile_definitions(helloworld PUBLIC "IS_GNU_CXX_COMPILER")
  message(STATUS "GNU COMPILER")
elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
  target_compile_definitions(helloworld PUBLIC "IS_MSVC_CXX_COMPILER")
  message(STATUS "MSVC COMPILER")
else()
  target_compile_definitions(helloworld PUBLIC "IS_OTHER_CXX_COMPILER")
endif()
